<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Document [
  <!ENTITY ppl  "http://example.com/people#">
  <!ENTITY cpt  "http://example.com/concepts#">
  <!ENTITY dc   "http://purl.org/dc/terms/">
  <!ENTITY rif  "http://www.w3.org/2007/rif#">
  <!ENTITY func "http://www.w3.org/2007/rif-builtin-function#">
  <!ENTITY pred "http://www.w3.org/2007/rif-builtin-predicate#">
  <!ENTITY xs   "http://www.w3.org/2001/XMLSchema#">
  <!ENTITY act "http://www.w3.org/2007/rif-builtin-action#">
]>
<Document
  xmlns="http://www.w3.org/2007/rif#"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <payload>
    <Group xmlns="http://www.w3.org/2007/rif#">
      <sentence>
        <Forall>
          <id>
            <Const type="xsd:string">parent1</Const>
          </id>
          <declare>
            <Var>p</Var>
          </declare>
          <formula>
            <Implies>
              <if>
                <And>
                  <formula>
                    <Exists>
                      <declare>
                        <Var>C</Var>
                      </declare>
                      <declare>
                        <Var>M</Var>
                      </declare>
                      <declare>
                        <Var>D</Var>
                      </declare>
                      <formula>
                        <And>
                          <formula>
                            <Member>
                              <instance>
                                <Var>p</Var>
                              </instance>
                              <class>
                                <Const type="rif:iri">parents</Const>
                              </class>
                            </Member>
                          </formula>
                          <formula>
                            <Frame>
                              <object>
                                <Var>p</Var>
                              </object>
                              <slot ordered="yes">
                                <Const type="rif:iri">p1</Const>
                                <Var>C</Var>
                              </slot>
                              <slot ordered="yes">
                                <Const type="rif:iri">p2</Const>
                                <Var>M</Var>
                              </slot>
                              <slot ordered="yes">
                                <Const type="rif:iri">p3</Const>
                                <Var>D</Var>
                              </slot>
                            </Frame>
                          </formula>
                        </And>
                      </formula>
                    </Exists>
                  </formula>
                </And>
              </if>
              <then>
                <Do>
                  <actions ordered="yes">
                    <Assert>
                      <target>
                        <Member>
                          <instance>
                            <Var>family.parent</Var>
                          </instance>
                          <class>
                            <Const type="rif:iri">family.parent</Const>
                          </class>
                        </Member>
                      </target>
                    </Assert>
                    <Assert>
                      <target>
                        <Frame>
                          <object>
                            <Var>family.parent</Var>
                          </object>
                          <slot ordered="yes">
                            <Const type="rif:iri">p1</Const>
                            <Var>C</Var>
                          </slot>
                          <slot ordered="yes">
                            <Const type="rif:iri">p2</Const>
                            <Var>M</Var>
                          </slot>
                        </Frame>
                      </target>
                    </Assert>
                  </actions>
                </Do>
              </then>
            </Implies>
          </formula>
        </Forall>
      </sentence>
      <sentence>
        <Forall>
          <id>
            <Const type="xsd:string">parent2</Const>
          </id>
          <declare>
            <Var>p</Var>
          </declare>
          <formula>
            <Implies>
              <if>
                <And>
                  <formula>
                    <Exists>
                      <declare>
                        <Var>C</Var>
                      </declare>
                      <declare>
                        <Var>M</Var>
                      </declare>
                      <declare>
                        <Var>D</Var>
                      </declare>
                      <formula>
                        <And>
                          <formula>
                            <Member>
                              <instance>
                                <Var>p</Var>
                              </instance>
                              <class>
                                <Const type="rif:iri">parents</Const>
                              </class>
                            </Member>
                          </formula>
                          <formula>
                            <Frame>
                              <object>
                                <Var>p</Var>
                              </object>
                              <slot ordered="yes">
                                <Const type="rif:iri">p1</Const>
                                <Var>C</Var>
                              </slot>
                              <slot ordered="yes">
                                <Const type="rif:iri">p2</Const>
                                <Var>M</Var>
                              </slot>
                              <slot ordered="yes">
                                <Const type="rif:iri">p3</Const>
                                <Var>D</Var>
                              </slot>
                            </Frame>
                          </formula>
                        </And>
                      </formula>
                    </Exists>
                  </formula>
                </And>
              </if>
              <then>
                <Do>
                  <actions ordered="yes">
                    <Assert>
                      <target>
                        <Member>
                          <instance>
                            <Var>family.parent</Var>
                          </instance>
                          <class>
                            <Const type="rif:iri">family.parent</Const>
                          </class>
                        </Member>
                      </target>
                    </Assert>
                    <Assert>
                      <target>
                        <Frame>
                          <object>
                            <Var>family.parent</Var>
                          </object>
                          <slot ordered="yes">
                            <Const type="rif:iri">p1</Const>
                            <Var>C</Var>
                          </slot>
                          <slot ordered="yes">
                            <Const type="rif:iri">p2</Const>
                            <Var>D</Var>
                          </slot>
                        </Frame>
                      </target>
                    </Assert>
                  </actions>
                </Do>
              </then>
            </Implies>
          </formula>
        </Forall>
      </sentence>
      <sentence>
        <Forall>
          <id>
            <Const type="xsd:string">sibling</Const>
          </id>
          <declare>
            <Var>ps1</Var>
          </declare>
          <declare>
            <Var>ps2</Var>
          </declare>
          <formula>
            <Implies>
              <if>
                <And>
                  <formula>
                    <Exists>
                      <declare>
                        <Var>X</Var>
                      </declare>
                      <declare>
                        <Var>M</Var>
                      </declare>
                      <declare>
                        <Var>D</Var>
                      </declare>
                      <formula>
                        <And>
                          <formula>
                            <Member>
                              <instance>
                                <Var>ps1</Var>
                              </instance>
                              <class>
                                <Const type="rif:iri">parents</Const>
                              </class>
                            </Member>
                          </formula>
                          <formula>
                            <Frame>
                              <object>
                                <Var>ps1</Var>
                              </object>
                              <slot ordered="yes">
                                <Const type="rif:iri">p1</Const>
                                <Var>X</Var>
                              </slot>
                              <slot ordered="yes">
                                <Const type="rif:iri">p2</Const>
                                <Var>M</Var>
                              </slot>
                              <slot ordered="yes">
                                <Const type="rif:iri">p3</Const>
                                <Var>D</Var>
                              </slot>
                            </Frame>
                          </formula>
                        </And>
                      </formula>
                    </Exists>
                  </formula>
                  <formula>
                    <Exists>
                      <declare>
                        <Var>Y</Var>
                      </declare>
                      <formula>
                        <And>
                          <formula>
                            <Member>
                              <instance>
                                <Var>ps2</Var>
                              </instance>
                              <class>
                                <Const type="rif:iri">parents</Const>
                              </class>
                            </Member>
                          </formula>
                          <formula>
                            <Frame>
                              <object>
                                <Var>ps2</Var>
                              </object>
                              <slot ordered="yes">
                                <Const type="rif:iri">p1</Const>
                                <Var>Y</Var>
                              </slot>
                            </Frame>
                          </formula>
                          <formula>
                            <External>
                              <content>
                                <Atom>
                                  <op>
                                    <Const type="rif:iri">http://www.w3.org/2007/rif-builtin-predicate#numeric-equal</Const>
                                  </op>
                                  <args ordered="yes">
                                    <Const type="rif:iri">p2</Const>
                                    <Var>M</Var>
                                  </args>
                                </Atom>
                              </content>
                            </External>
                          </formula>
                          <formula>
                            <External>
                              <content>
                                <Atom>
                                  <op>
                                    <Const type="rif:iri">http://www.w3.org/2007/rif-builtin-predicate#numeric-equal</Const>
                                  </op>
                                  <args ordered="yes">
                                    <Const type="rif:iri">p3</Const>
                                    <Var>D</Var>
                                  </args>
                                </Atom>
                              </content>
                            </External>
                          </formula>
                          <formula>
                            <External>
                              <content>
                                <Atom>
                                  <op>
                                    <Const type="rif:iri">http://www.w3.org/2007/rif-builtin-predicate#numeric-not-equal</Const>
                                  </op>
                                  <args ordered="yes">
                                    <Var>X</Var>
                                    <Var>Y</Var>
                                  </args>
                                </Atom>
                              </content>
                            </External>
                          </formula>
                        </And>
                      </formula>
                    </Exists>
                  </formula>
                </And>
              </if>
              <then>
                <Do>
                  <actions ordered="yes">
                    <Assert>
                      <target>
                        <Member>
                          <instance>
                            <Var>family.sibling</Var>
                          </instance>
                          <class>
                            <Const type="rif:iri">family.sibling</Const>
                          </class>
                        </Member>
                      </target>
                    </Assert>
                    <Assert>
                      <target>
                        <Frame>
                          <object>
                            <Var>family.sibling</Var>
                          </object>
                          <slot ordered="yes">
                            <Const type="rif:iri">p1</Const>
                            <Var>X</Var>
                          </slot>
                          <slot ordered="yes">
                            <Const type="rif:iri">p2</Const>
                            <Var>Y</Var>
                          </slot>
                        </Frame>
                      </target>
                    </Assert>
                  </actions>
                </Do>
              </then>
            </Implies>
          </formula>
        </Forall>
      </sentence>
      <sentence>
        <Forall>
          <id>
            <Const type="xsd:string">aORuDirect</Const>
          </id>
          <declare>
            <Var>p</Var>
          </declare>
          <declare>
            <Var>s</Var>
          </declare>
          <formula>
            <Implies>
              <if>
                <And>
                  <formula>
                    <Exists>
                      <declare>
                        <Var>C</Var>
                      </declare>
                      <declare>
                        <Var>P</Var>
                      </declare>
                      <formula>
                        <And>
                          <formula>
                            <Member>
                              <instance>
                                <Var>p</Var>
                              </instance>
                              <class>
                                <Const type="rif:iri">parent</Const>
                              </class>
                            </Member>
                          </formula>
                          <formula>
                            <Frame>
                              <object>
                                <Var>p</Var>
                              </object>
                              <slot ordered="yes">
                                <Const type="rif:iri">p1</Const>
                                <Var>C</Var>
                              </slot>
                              <slot ordered="yes">
                                <Const type="rif:iri">p2</Const>
                                <Var>P</Var>
                              </slot>
                            </Frame>
                          </formula>
                        </And>
                      </formula>
                    </Exists>
                  </formula>
                  <formula>
                    <Exists>
                      <declare>
                        <Var>A</Var>
                      </declare>
                      <formula>
                        <And>
                          <formula>
                            <Member>
                              <instance>
                                <Var>s</Var>
                              </instance>
                              <class>
                                <Const type="rif:iri">sibling</Const>
                              </class>
                            </Member>
                          </formula>
                          <formula>
                            <Frame>
                              <object>
                                <Var>s</Var>
                              </object>
                              <slot ordered="yes">
                                <Const type="rif:iri">p2</Const>
                                <Var>A</Var>
                              </slot>
                            </Frame>
                          </formula>
                          <formula>
                            <External>
                              <content>
                                <Atom>
                                  <op>
                                    <Const type="rif:iri">http://www.w3.org/2007/rif-builtin-predicate#numeric-equal</Const>
                                  </op>
                                  <args ordered="yes">
                                    <Const type="rif:iri">p1</Const>
                                    <Var>P</Var>
                                  </args>
                                </Atom>
                              </content>
                            </External>
                          </formula>
                        </And>
                      </formula>
                    </Exists>
                  </formula>
                </And>
              </if>
              <then>
                <Do>
                  <actions ordered="yes">
                    <Assert>
                      <target>
                        <Member>
                          <instance>
                            <Var>family.aORuDirect</Var>
                          </instance>
                          <class>
                            <Const type="rif:iri">family.aORuDirect</Const>
                          </class>
                        </Member>
                      </target>
                    </Assert>
                    <Assert>
                      <target>
                        <Frame>
                          <object>
                            <Var>family.aORuDirect</Var>
                          </object>
                          <slot ordered="yes">
                            <Const type="rif:iri">p1</Const>
                            <Var>C</Var>
                          </slot>
                          <slot ordered="yes">
                            <Const type="rif:iri">p2</Const>
                            <Var>A</Var>
                          </slot>
                        </Frame>
                      </target>
                    </Assert>
                  </actions>
                </Do>
              </then>
            </Implies>
          </formula>
        </Forall>
      </sentence>
      <sentence>
        <Forall>
          <id>
            <Const type="xsd:string">aORuMarriage1</Const>
          </id>
          <declare>
            <Var>ord</Var>
          </declare>
          <declare>
            <Var>m</Var>
          </declare>
          <formula>
            <Implies>
              <if>
                <And>
                  <formula>
                    <Exists>
                      <declare>
                        <Var>C</Var>
                      </declare>
                      <declare>
                        <Var>X</Var>
                      </declare>
                      <formula>
                        <And>
                          <formula>
                            <Member>
                              <instance>
                                <Var>ord</Var>
                              </instance>
                              <class>
                                <Const type="rif:iri">aORuDirect</Const>
                              </class>
                            </Member>
                          </formula>
                          <formula>
                            <Frame>
                              <object>
                                <Var>ord</Var>
                              </object>
                              <slot ordered="yes">
                                <Const type="rif:iri">p1</Const>
                                <Var>C</Var>
                              </slot>
                              <slot ordered="yes">
                                <Const type="rif:iri">p2</Const>
                                <Var>X</Var>
                              </slot>
                            </Frame>
                          </formula>
                        </And>
                      </formula>
                    </Exists>
                  </formula>
                  <formula>
                    <Exists>
                      <declare>
                        <Var>A</Var>
                      </declare>
                      <formula>
                        <And>
                          <formula>
                            <Member>
                              <instance>
                                <Var>m</Var>
                              </instance>
                              <class>
                                <Const type="rif:iri">married</Const>
                              </class>
                            </Member>
                          </formula>
                          <formula>
                            <Frame>
                              <object>
                                <Var>m</Var>
                              </object>
                              <slot ordered="yes">
                                <Const type="rif:iri">p2</Const>
                                <Var>A</Var>
                              </slot>
                            </Frame>
                          </formula>
                          <formula>
                            <External>
                              <content>
                                <Atom>
                                  <op>
                                    <Const type="rif:iri">http://www.w3.org/2007/rif-builtin-predicate#numeric-equal</Const>
                                  </op>
                                  <args ordered="yes">
                                    <Const type="rif:iri">p1</Const>
                                    <Var>X</Var>
                                  </args>
                                </Atom>
                              </content>
                            </External>
                          </formula>
                        </And>
                      </formula>
                    </Exists>
                  </formula>
                </And>
              </if>
              <then>
                <Do>
                  <actions ordered="yes">
                    <Assert>
                      <target>
                        <Member>
                          <instance>
                            <Var>family.aORuMarriage</Var>
                          </instance>
                          <class>
                            <Const type="rif:iri">family.aORuMarriage</Const>
                          </class>
                        </Member>
                      </target>
                    </Assert>
                    <Assert>
                      <target>
                        <Frame>
                          <object>
                            <Var>family.aORuMarriage</Var>
                          </object>
                          <slot ordered="yes">
                            <Const type="rif:iri">p1</Const>
                            <Var>C</Var>
                          </slot>
                          <slot ordered="yes">
                            <Const type="rif:iri">p2</Const>
                            <Var>A</Var>
                          </slot>
                        </Frame>
                      </target>
                    </Assert>
                  </actions>
                </Do>
              </then>
            </Implies>
          </formula>
        </Forall>
      </sentence>
      <sentence>
        <Forall>
          <id>
            <Const type="xsd:string">aORuMarriage2</Const>
          </id>
          <declare>
            <Var>ord</Var>
          </declare>
          <declare>
            <Var>m</Var>
          </declare>
          <formula>
            <Implies>
              <if>
                <And>
                  <formula>
                    <Exists>
                      <declare>
                        <Var>C</Var>
                      </declare>
                      <declare>
                        <Var>X</Var>
                      </declare>
                      <formula>
                        <And>
                          <formula>
                            <Member>
                              <instance>
                                <Var>ord</Var>
                              </instance>
                              <class>
                                <Const type="rif:iri">aORuDirect</Const>
                              </class>
                            </Member>
                          </formula>
                          <formula>
                            <Frame>
                              <object>
                                <Var>ord</Var>
                              </object>
                              <slot ordered="yes">
                                <Const type="rif:iri">p1</Const>
                                <Var>C</Var>
                              </slot>
                              <slot ordered="yes">
                                <Const type="rif:iri">p2</Const>
                                <Var>X</Var>
                              </slot>
                            </Frame>
                          </formula>
                        </And>
                      </formula>
                    </Exists>
                  </formula>
                  <formula>
                    <Exists>
                      <declare>
                        <Var>A</Var>
                      </declare>
                      <formula>
                        <And>
                          <formula>
                            <Member>
                              <instance>
                                <Var>m</Var>
                              </instance>
                              <class>
                                <Const type="rif:iri">married</Const>
                              </class>
                            </Member>
                          </formula>
                          <formula>
                            <Frame>
                              <object>
                                <Var>m</Var>
                              </object>
                              <slot ordered="yes">
                                <Const type="rif:iri">p1</Const>
                                <Var>A</Var>
                              </slot>
                            </Frame>
                          </formula>
                          <formula>
                            <External>
                              <content>
                                <Atom>
                                  <op>
                                    <Const type="rif:iri">http://www.w3.org/2007/rif-builtin-predicate#numeric-equal</Const>
                                  </op>
                                  <args ordered="yes">
                                    <Const type="rif:iri">p2</Const>
                                    <Var>X</Var>
                                  </args>
                                </Atom>
                              </content>
                            </External>
                          </formula>
                        </And>
                      </formula>
                    </Exists>
                  </formula>
                </And>
              </if>
              <then>
                <Do>
                  <actions ordered="yes">
                    <Assert>
                      <target>
                        <Member>
                          <instance>
                            <Var>family.aORuMarriage</Var>
                          </instance>
                          <class>
                            <Const type="rif:iri">family.aORuMarriage</Const>
                          </class>
                        </Member>
                      </target>
                    </Assert>
                    <Assert>
                      <target>
                        <Frame>
                          <object>
                            <Var>family.aORuMarriage</Var>
                          </object>
                          <slot ordered="yes">
                            <Const type="rif:iri">p1</Const>
                            <Var>C</Var>
                          </slot>
                          <slot ordered="yes">
                            <Const type="rif:iri">p2</Const>
                            <Var>A</Var>
                          </slot>
                        </Frame>
                      </target>
                    </Assert>
                  </actions>
                </Do>
              </then>
            </Implies>
          </formula>
        </Forall>
      </sentence>
      <sentence>
        <Forall>
          <id>
            <Const type="xsd:string">aORu1</Const>
          </id>
          <declare>
            <Var>ao1</Var>
          </declare>
          <formula>
            <Implies>
              <if>
                <And>
                  <formula>
                    <Exists>
                      <declare>
                        <Var>C</Var>
                      </declare>
                      <declare>
                        <Var>A</Var>
                      </declare>
                      <formula>
                        <And>
                          <formula>
                            <Member>
                              <instance>
                                <Var>ao1</Var>
                              </instance>
                              <class>
                                <Const type="rif:iri">aORuDirect</Const>
                              </class>
                            </Member>
                          </formula>
                          <formula>
                            <Frame>
                              <object>
                                <Var>ao1</Var>
                              </object>
                              <slot ordered="yes">
                                <Const type="rif:iri">p1</Const>
                                <Var>C</Var>
                              </slot>
                              <slot ordered="yes">
                                <Const type="rif:iri">p2</Const>
                                <Var>A</Var>
                              </slot>
                            </Frame>
                          </formula>
                        </And>
                      </formula>
                    </Exists>
                  </formula>
                </And>
              </if>
              <then>
                <Do>
                  <actions ordered="yes">
                    <Assert>
                      <target>
                        <Member>
                          <instance>
                            <Var>family.aORu</Var>
                          </instance>
                          <class>
                            <Const type="rif:iri">family.aORu</Const>
                          </class>
                        </Member>
                      </target>
                    </Assert>
                    <Assert>
                      <target>
                        <Frame>
                          <object>
                            <Var>family.aORu</Var>
                          </object>
                          <slot ordered="yes">
                            <Const type="rif:iri">p1</Const>
                            <Var>C</Var>
                          </slot>
                          <slot ordered="yes">
                            <Const type="rif:iri">p2</Const>
                            <Var>A</Var>
                          </slot>
                        </Frame>
                      </target>
                    </Assert>
                  </actions>
                </Do>
              </then>
            </Implies>
          </formula>
        </Forall>
      </sentence>
      <sentence>
        <Forall>
          <id>
            <Const type="xsd:string">aORu2</Const>
          </id>
          <declare>
            <Var>ao2</Var>
          </declare>
          <formula>
            <Implies>
              <if>
                <And>
                  <formula>
                    <Exists>
                      <declare>
                        <Var>C</Var>
                      </declare>
                      <declare>
                        <Var>A</Var>
                      </declare>
                      <formula>
                        <And>
                          <formula>
                            <Member>
                              <instance>
                                <Var>ao2</Var>
                              </instance>
                              <class>
                                <Const type="rif:iri">aORuMarriage</Const>
                              </class>
                            </Member>
                          </formula>
                          <formula>
                            <Frame>
                              <object>
                                <Var>ao2</Var>
                              </object>
                              <slot ordered="yes">
                                <Const type="rif:iri">p1</Const>
                                <Var>C</Var>
                              </slot>
                              <slot ordered="yes">
                                <Const type="rif:iri">p2</Const>
                                <Var>A</Var>
                              </slot>
                            </Frame>
                          </formula>
                        </And>
                      </formula>
                    </Exists>
                  </formula>
                </And>
              </if>
              <then>
                <Do>
                  <actions ordered="yes">
                    <Assert>
                      <target>
                        <Member>
                          <instance>
                            <Var>family.aORu</Var>
                          </instance>
                          <class>
                            <Const type="rif:iri">family.aORu</Const>
                          </class>
                        </Member>
                      </target>
                    </Assert>
                    <Assert>
                      <target>
                        <Frame>
                          <object>
                            <Var>family.aORu</Var>
                          </object>
                          <slot ordered="yes">
                            <Const type="rif:iri">p1</Const>
                            <Var>C</Var>
                          </slot>
                          <slot ordered="yes">
                            <Const type="rif:iri">p2</Const>
                            <Var>A</Var>
                          </slot>
                        </Frame>
                      </target>
                    </Assert>
                  </actions>
                </Do>
              </then>
            </Implies>
          </formula>
        </Forall>
      </sentence>
    </Group>
  </payload>
</Document>

